package com.tudouji.project.system.service.impl;

import com.tudouji.project.system.domain.Tmessage;
import com.tudouji.project.system.mapper.TmessageMapper;
import com.tudouji.project.system.service.ITmessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 短信验证码Service业务层处理
 * 
 * @author coal
 * @date 2021-08-18
 */
@Service
public class TmessageServiceImpl implements ITmessageService
{
    @Autowired
    private TmessageMapper tmessageMapper;

    /**
     * 查询短信验证码
     * 
     * @param id 短信验证码ID
     * @return 短信验证码
     */
    @Override
    public Tmessage selectTmessageById(Long id)
    {
        return tmessageMapper.selectTmessageById(id);
    }

    /**
     * 查询短信验证码列表
     * 
     * @param tmessage 短信验证码
     * @return 短信验证码
     */
    @Override
    public List<Tmessage> selectTmessageList(Tmessage tmessage)
    {
        return tmessageMapper.selectTmessageList(tmessage);
    }

    /**
     * 新增短信验证码
     * 
     * @param tmessage 短信验证码
     * @return 结果
     */
    @Override
    public int insertTmessage(Tmessage tmessage)
    {
        return tmessageMapper.insertTmessage(tmessage);
    }

    /**
     * 修改短信验证码
     * 
     * @param tmessage 短信验证码
     * @return 结果
     */
    @Override
    public int updateTmessage(Tmessage tmessage)
    {
        return tmessageMapper.updateTmessage(tmessage);
    }

    /**
     * 批量删除短信验证码
     * 
     * @param ids 需要删除的短信验证码ID
     * @return 结果
     */
    @Override
    public int deleteTmessageByIds(Long[] ids)
    {
        return tmessageMapper.deleteTmessageByIds(ids);
    }

    /**
     * 删除短信验证码信息
     * 
     * @param id 短信验证码ID
     * @return 结果
     */
    @Override
    public int deleteTmessageById(Long id)
    {
        return tmessageMapper.deleteTmessageById(id);
    }

    @Override
    public Tmessage getLastMessageByPhone(Tmessage tmessage)
    {
        return tmessageMapper.getLastMessageByPhone(tmessage);
    }
}
